package com.splic.framework.shiro.service;

import com.splic.common.core.DeviceContext;
import com.splic.common.utils.ShiroUtils;
import com.splic.common.utils.StringUtils;
import com.splic.product.dto.DeviceDto;
import com.splic.product.facade.DeviceFacade;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * ==========================
 * 开发：yuxiangjie
 * 创建时间：2022-03-21 19:18
 * 版本: 1.0
 * 描述：TODO
 * ==========================
 */
@Component
@Slf4j
public class SysDeviceService {

    @Autowired
    private DeviceFacade deviceFacade;

    public String interfaceNeedInfo(DeviceDto device){
        if (StringUtils.isBlank(device.getAndroidId())
                && StringUtils.isBlank(device.getMac())
                && StringUtils.isBlank(device.getOaid())
                && StringUtils.isBlank(device.getVaid())
                && StringUtils.isBlank(device.getGaid())
                && StringUtils.isBlank(device.getImei())
                && StringUtils.isBlank(device.getDeviceIdentify())) {
            return "";
        }
        device.setUserId(ShiroUtils.getUserId());
        return deviceFacade.interfaceNeedInfo(device);
    }
}
